<template>
	<view class="">
		<cu-custom bgColor="bg-gradual-blue">
			<block slot="content">我的报名</block>
		</cu-custom>
		<scroll-view scroll-x class="bg-white nav">
			<view class="flex text-center">
				<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''" v-for="(item,index) in tabList" :key="index" @tap="tabSelect" :data-id="index">
					{{item}}
				</view>
			</view>
		</scroll-view>
		<view v-if="0==TabCur">
			<view class="cu-list menu-avatar">
				<view class="cu-item" v-for="(item,index) in activityList" :key="index" @tap="routerToDetails" :data-id="item.id">
					<view class="cu-avatar radius lg" 
						  :style="[{ backgroundImage:'url(' + (item.iconUrl || '/static/no_pictrue.jpg')  + ')' }]">
					</view>
					<view class="content">
						<view class="text-grey">{{item.title}}</view>
						<view class="text-gray text-sm flex">
							<view class="text-cut">
								<text class="cuIcon-friend gray margin-right-xs"></text>
									<text>0/{{item.maxCount}}</text>
									<text style="padding-left: 10px;">￥{{item.fee}}</text>
							</view> 
						</view>
					</view>
					<view class="action">
						<view class="text-grey text-xs"></view>
						<view class="cu-tag sm" :class="true?'line-grey':'line-blue'">{{status[1]}}</view>
					</view>
				</view>
			</view>
		</view>
		<view v-if="1==TabCur" class="bg-grey padding margin text-center">
			11
		</view>
		<view v-if="2==TabCur" class="bg-grey padding margin text-center">
			111
		</view>
		<view class="cu-tabbar-height"></view>
	</view>
</template>

<script>
	import {baseUrl} from '@/config/index';
	
	export default {
		data() {
			return {
				tabList:['我管理的', '我参与的', '我收藏的'],
				status:['进行中', '未开始', '已结束'],
				TabCur: 0,
			};
		},
		props: {
			activityList: Array
		},
		methods: {
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
			},
			routerToDetails(e) {
				const ID = e.currentTarget.dataset.id;
				uni.navigateTo({
					url: `/pages/main/enroll/details?id=${ID}`,
				});
			}
		}
	};
</script>

<style>
</style>
